package com.atom.module.author.mapper;

import com.atom.module.author.pojo.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface RoleMapper {

    //通过id , 软删除
    @Update("""
                UPDATE tb_role
                SET deleted = 1 , version = version + 1
                WHERE id = #{id}
            """)
    Boolean deleteByPrimaryKey(Long id);

    //删除
    @Delete("DELETE FROM tb_role where deleted = 1")
    Integer delete();

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);


}
